﻿using NetworkLib.Utilities;
using PBO.Network.Enumerations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PBO.Network.Domain
{
    public class BattleRuleSequence : DataByteArray
    {
        public BattleRule[] Rules { get; set; }

        public override void Read(ByteArray byteArray)
        {
            this.Rules = DataByteArray.ReadArray<BattleRule>(byteArray, t => (BattleRule)t.ReadInt());
        }

        public override void Write(ByteArray byteArray)
        {
            DataByteArray.WriteArray<BattleRule>(this.Rules, byteArray, (t, s) => t.WriteInt((int)s));
        }
    }
}
